#include <iostream>
#include "room.h"
#include "building.h"
using namespace std;

void main3_1(){
	cout << "Uppgift 3.1" << endl;
	room r1, r2(25.6,"sovrum");

	cout << r1.GetArea() << endl << r1.GetTypeOfRoom() << endl;
	cout << r2.GetArea() << endl << r2.GetTypeOfRoom() << endl;

	r1.SetArea(31.3);
	r1.SetTypeOfRoom("living");
	cout << r1.GetArea() << endl << r1.GetTypeOfRoom() << endl;
}

void main3_2(){
	cout << "Uppgift 3.2 " << endl;
	room r1;

	r1.read();
	r1.write();
}
void main3_3(){
	cout << "Uppgift 3.3" << endl;
	room r1, r2(25.6,"sovrum");

	cout << r1 << endl << r2 << endl;

	cout << "Fyll i data om rummet enligt mallen: ('area','typ av rum') " << endl;
	cin >> r1;
	cout << r1 << endl;
}
void main3_4(){
	cout << "Uppgift 3.4" << endl;
	room r1(10.5,"badrum"), r2(25.6,"sovrum"), r3(20.0,"matsal");
	building b("1A");

	b.add(r1);
	b.add(r2);
	b.add(r3);
	cout << b.list() << endl << endl;

	b.search();
	cout << endl << endl;
	
	b.Delete();
	cout <<b.list();

}
void main3_5(){
	cout << "Uppgift 3.5" << endl;
	room r1(10.5,"badrum"), r2(25.6,"sovrum"), r3(33,"vardagsrum");
	building b("1A");

	b.add(r1);
	b.add(r2);
	b.add(r3);
	b.writeToFile("HusFil.txt");
}
void main3_6(){
	cout << "Uppgift 3.6" << endl;
	building b;

	b.readFromFile("HusFil.txt");

	cout << b.list();
}
void main3_7(){
	cout << "Uppgift 3.7" << endl;
	building b;
	room r1(10.5,"badrum"), r2(25.6,"sovrum"), r3(33,"vardagsrum");

	b.add(r1);
	b.add(r2);
	b.add(r3);

	b.area();
}

int main(){
	setlocale(LC_ALL,"swedish");

	//main3_1();
	//main3_2();
	//main3_3();
	//main3_4();
	//main3_5();
	//main3_6();
	main3_7();
	system("pause");

}